const bcrypt = require('bcryptjs')
// 生成token方法
const jwt = require('jsonwebtoken')
// 密匙
const secret = 'dbNb'
exports.setbcrypt = function(key) {
	return bcrypt.hashSync(key, 10)
}
exports.comparebcrypt = function(key, key1) {
	return bcrypt.compareSync(key, key1)
}
exports.getToken = function(obj) {
	return jwt.sign(obj, secret, {
		expiresIn: '7d'
	});
}